<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>用户扣款记录</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
    <script type="text/javascript">
        var grid = null;
        $(function () {
            $("#searchBar").ligerForm();
            $("#ligergrid1").ligerGrid({
                url: '<%=path%>/custpay/cmmEmppayRecord/initCmmEmppayRecordList.do',
                method : 'get',
                parms:getSearchParams(),
                columns: [
                    { display: '订单号', name: 'id', minWidth: 150, align: 'center', enabledSort:true},
                    { display: '姓名', name: 'rlNm', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '工号', name: 'usrNm', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '支付表号', name: 'paySchNo', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '费用项名称', name: 'feeTypCdNm', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '费用金额', name: 'feeAmtMndou', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '实际金额(元)', name: 'paymentMoneydou', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '支付状态', name: 'isSucNm', minWidth: 80, align: 'center', enabledSort:true},
                    { display: '结果描述', name: 'resultDesc', minWidth: 80, align: 'center', enabledSort:true},
                    { display: '扣款帐号', name: 'accNo', minWidth: 80, align: 'center', enabledSort:true},
                    { display: '支付平台', name: 'payTypeNm', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '支付类型', name: 'paymentTypeNm', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '是否自动代扣', name: 'isAutoChargeNm', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '还款时间', name: 'crtTm', minWidth: 150, render:renderDate, align: 'center', enabledSort:true}
                ],
                pageSize:10,
                root:'rows',
                record:'total',
                hideLoadButton : true,
                width: '100%',
                height:'100%',
                heightDiff:-2,
                //checkbox:true,
                rownumbers:false,
                onBeforeShowData: function ()
                {
                    var grid = this;
                    grid.collapsedRows = [];
                }
            });
            grid = liger.get("ligergrid1");

            $("#searchBtn").click(function(event) {
                var form = new liger.get("searchBar");
                var data = form.getData();
                console.log(data);
                for (name in data){
                    grid.setParm(name,data[name]);
                };
                grid.reload();
            });
            $("#clearBtn").click(function(event) {
                clearLigerForm("searchBar");
            });
            $("#dateform").ligerForm();
        });

        //查询参数
        function getSearchParams(){
            var form = new liger.get("searchBar");
            var data = form.getData();
            return data;
        }
        //格式化时间
        function renderDate(rowdata, index, value){
            var dateStr = "";
            if(null != value){
                var date = new Date(value);
                dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
            }
            return dateStr;
        }
        //导出

        function exportInfBfsPayExcel(){
            var form = liger.get("searchBar");
            var data = form.getData();
            var req="format=xls";
            for (name in data) {
                for (name in data) {
                    if(data[name]){
                        req+="&"+name+"="+data[name];
                    }
                }
            }
            window.location.href="<%=path%>/custpay/cmmEmppayRecord/exportCmmEmppayRecordExcel.do?"+req;
        }
    </script>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">状态</div>
                    <div class="field">
                        <select name="isSuc"  id="isSuc"  disabled="disabled">
                            <option value="  " selected="selected">--请选择--</option>
                            <c:forEach items="${statuslist}" var="opt">
                                <option value="${opt.key}" <c:if test="${opt.key==1}">selected</c:if>>${opt.value}</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">订单号</div>
                    <div class="field">
                        <input name="orderid" id="orderid" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">工号</div>
                    <div class="field">
                        <input name="usrNm" id="usrNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">姓名</div>
                    <div class="field">
                        <input name="rlNm" id="rlNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">还款时间(起)</div>
                    <div class="field">
                        <input name="crtTmBegin" id="crtTmBegin" type="text" class="ui-datepicker" value="">
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">还款时间(止)</div>
                    <div class="field">
                        <input name="crtTmEnd" id="crtTmEnd" type="text" class="ui-datepicker" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">是否自动代扣</div>
                    <div class="field">
                        <select name="isAutoCharge"  id="isAutoCharge"  disabled="disabled">
                            <option value="  " selected="selected">--请选择--</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="clearFix"></div>
                <div class="btnsBox">
                    <span id="searchBtn" class="sq-button sq-button-hasicon"><i class="sqBtnIco_1"></i>查询</span>
                    <span id="clearBtn" class="sq-button sq-button-hasicon"><i class="sqBtnIco_19"></i>清空</span>
                    <span class="sq-button sq-button-hasicon" onclick="exportInfBfsPayExcel()"><i class="sqBtnIco_21"></i>导出</span>
                    <input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
                </div>
            </div>
        </form>
    </div>
</div>
<div id="ligergrid1" class="sq-grid"></div>
</body>
</html>
